home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-06-30 | 4.1 KB | 137 lines |
- /*
- * @(#)JSeparator.java 1.18 98/02/12
- *
- * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
- *
- * This software is the confidential and proprietary information of Sun
- * Microsystems, Inc. ("Confidential Information"). You shall not
- * disclose such Confidential Information and shall use it only in
- * accordance with the terms of the license agreement you entered into
- * with Sun.
- *
- * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
- * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
- * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
- * THIS SOFTWARE OR ITS DERIVATIVES.
- *
- */
-
- package com.sun.java.swing;
- import com.sun.java.swing.plaf.*;
- import com.sun.java.accessibility.*;
-
- /**
- * An implementation of a Menu Separator -- a divider between menu items
- * that breaks them up into logical groupings.
- * <p>
- * Warning: serialized objects of this class will not be compatible with
- * future swing releases. The current serialization support is appropriate
- * for short term storage or RMI between Swing1.0 applications. It will
- * not be possible to load serialized Swing1.0 objects with future releases
- * of Swing. The JDK1.2 release of Swing will be the compatibility
- * baseline for the serialized form of Swing objects.
- *
- * @beaninfo
- * attribute: isContainer false
- * @version 1.18 02/12/98
- * @author Georges Saab
- * @author David Karlton
- */
- public class JSeparator extends JComponent implements Accessible
- {
- /** Create a new separator */
- public JSeparator() {
- updateUI();
- }
-
- /**
- /**
- * Returns the L&F object that renders this component.
- *
- * @return the SeparatorUI object that renders this component
- */
- public SeparatorUI getUI() {
- return (SeparatorUI)ui;
- }
-
- /**
- * Sets the L&F object that renders this component.
- *
- * @param ui the SeparatorUI L&F object
- * @see UIDefaults#getUI
- * @beaninfo
- * description: The menu item's UI delegate
- * bound: true
- * expert: true
- * hidden: true
- */
- public void setUI(SeparatorUI ui) {
- super.setUI(ui);
- }
-
- /**
- * Notification from the UIFactory that the L&F has changed.
- * Called to replace the UI with the latest version from the
- * UIFactory.
- *
- * @see JComponent#updateUI
- */
- public void updateUI() {
- setUI((SeparatorUI)UIManager.getUI(this));
- }
-
-
- /**
- * Returns the name of the L&F class that renders this component.
- *
- * @return "SeparatorUI"
- * @see JComponent#getUIClassID
- * @see UIDefaults#getUI
- */
- public String getUIClassID() {
- return "SeparatorUI";
- }
-
-
- /////////////////
- // Accessibility support
- ////////////////
-
- /**
- * Get the AccessibleContext associated with this JComponent
- *
- * @return the AccessibleContext of this JComponent
- */
- public AccessibleContext getAccessibleContext() {
- if (accessibleContext == null) {
- accessibleContext = new AccessibleJSeparator();
- }
- return accessibleContext;
- }
-
- /**
- * The class used to obtain the accessible role for this object.
- * <p>
- * Warning: serialized objects of this class will not be compatible with
- * future swing releases. The current serialization support is appropriate
- * for short term storage or RMI between Swing1.0 applications. It will
- * not be possible to load serialized Swing1.0 objects with future releases
- * of Swing. The JDK1.2 release of Swing will be the compatibility
- * baseline for the serialized form of Swing objects.
- */
- protected class AccessibleJSeparator extends AccessibleJComponent {
-
- /**
- * Get the role of this object.
- *
- * @return an instance of AccessibleRole describing the role of the
- * object
- */
- public AccessibleRole getAccessibleRole() {
- return AccessibleRole.SEPARATOR;
- }
- }
- }
-